package com.amkai.aes.webservice.binary.objecthandler.importer;

import java.io.Serializable;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.amkai.aes.aescommon.service.importer.ImporterJob;
import com.amkai.aes.aescommon.service.importer.ImporterResult;
import com.amkai.aes.server.importer.ImporterProvider;
import com.amkai.aes.webservice.binary.JobObjectHandler;

public class ImporterHandler implements JobObjectHandler<ImporterJob, Serializable, ImporterResult> {
	private static final Log logger = LogFactory.getLog(ImporterHandler.class);
	
	public ImporterResult process(ImporterJob job, Serializable object) throws Exception {
		ImporterProvider mp = new ImporterProvider();
		try {
			return mp.processJob(job, object);
		} catch (Throwable e) {
			logger.error("DataExportHandler: ", e);
			throw new Exception(e);
		}
	}

}
